<!-- VISTA DE LOS PROYECTOS DE LA ORGANIZACION -->
<?php if (isset($projects)) {  ?>

   
    <div class="row-fluid ">
        <div class="span12">
            <div class="span8">
                <h1>Projectos :  </h1>
                <p><small>En  <?php echo $org['Organization']['name']; ?></small></p>
            </div>
            <div class="span4" align="right">
                <a href="<?php echo $this->base; ?>/projects/add/<?php echo $org['Organization']['id']; ?>" class="btn btn-inverse"><i class="icon-plus-sign icon-white"></i> Nuevo</a>
            </div>
        </div>
    </div>
    

<div class="row-fluid ">
        <div class="span12">
            <?php if((isset($projects))&&(count($projects)>0)){ ?>
                <?php foreach ($projects as $project): ?>
                <div class="row-fluid " style=" margin-bottom: 20px;  margin-top: 20px;">
                    <div class="span12">
<!--                        <div class="span3">
                            <a href="#" class="thumbnail"  style=" border: none; box-shadow: none;">
                                <?php
                                echo $this->Html->image('projects.png') ;
                            ?>
                            </a>
                            <div class="mfProjectItemThumb13B241FADC5D8CEFF1E9860FE3E9A7D0 ui-draggable" style=" position: relative; width: 60px; height: 60px; top: -100px; left: 80px; overflow: hidden; ">
                                <img alt="" onerror="this.style.display='none'" style="height: 100%;" src="http://mfassets.s3.amazonaws.com/company/C68F6E32703B5C0B3EFF486008D757E76/mockup/13B241FADC5D8CEFF1E9860FE3E9A7D0">
                            </div>
                        </div>-->
                        <div class="span3">
                            <a href="#" class="thumbnail"  style=" border: none; box-shadow: none;">
                                <?php
                                echo $this->Html->image('projects.png') ;
                            ?>
                            
                                <img alt="" style="position: relative; width: 60px; height: 60px; overflow: hidden;  top: -100px; " src="http://mfassets.s3.amazonaws.com/company/C68F6E32703B5C0B3EFF486008D757E76/mockup/13B241FADC5D8CEFF1E9860FE3E9A7D0">
                            </a>
                        </div>
                        
                        <div class="span9">
                            <div class="caption">
                                <h3>
                                    <?php  echo $this->Html->link($project['Project']['name'],array('controller'=>'projects','action'=>'view',$project['Project']['id'])); ?>
                                </h3>
                                <p>
                                    <?php echo $project['Project']['description']?>
                                </p>
                                </p>
                                    <?php echo $this->Form->postLink(
                                        'Delete',
                                        array('action' => 'delete', $project['Project']['id']),
                                        array('class' => 'btn btn-danger','confirm' => 'Are you sure?'));
                                    ?>
                                    <?php echo $this->Html->link('Edit', array('action' => 'edit', $project['Project']['id']),array('class' => 'btn btn-primary')); ?>
                                 </p> 
                                
                            </div>
                        </div>
                    </div>
                </div>
                <?php endforeach; ?>
            <?php } else {?>
            <div class="alert alert-info">
                No se han creado proyectos para esta organizacion
            </div>
            <?php } ?>
        </div>
</div>

   
    <table>
            <tr>
                <th>Nombre</th>
                <th>Action</th>
            <tr>
        <?php foreach ($projects as $project): ?>
            <tr>
                <td> <?php
//                    echo h($projects[$i]['name']);
                    echo $this->Html->link($project['Project']['name'],array('action'=>'view',$project['Project']['id'])); 
                    ?>
                </td>
                <td>
                    <?php echo $this->Html->link('Edit', array('action' => 'edit',$project['Project']['id'])); ?>
                    <?php echo $this->Form->postLink(
                        'Delete',
                        array('action' => 'delete',$project['Project']['id']),
                        array('confirm' => 'Are you sure?'));
                    ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </table>
    
<!--    
    <table>
        <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Created</th>
            <th>Modified</th>
            <th>Action</th>
        </tr>

        <?php foreach ($orgs as $org): ?>
        <tr>
            <td>
                <?php echo $this->Html->link($org['Organization']['name'],array('controller' => 'organizations', 'action' => 'view', $org['Organization']['id'])); ?>
            </td>
            <td><?php echo substr ($org['Organization']['description'],0,100); ?></td>
            <td><?php echo $org['Organization']['created']; ?></td>
            <td><?php echo $org['Organization']['modified']; ?></td>
            <td>
                <?php echo $this->Form->postLink(
                    'Delete',
                    array('action' => 'delete', $org['Organization']['id']),
                    array('confirm' => 'Are you sure?'));
                ?>
                <?php echo $this->Html->link('Edit', array('action' => 'edit', $org['Organization']['id'])); ?>
            </td>
            
        </tr>
        <?php endforeach; ?>

    </table>-->

<?php } else {?>
    <br/>
    <div class="alert alert-info">
        Error de acceso.
    </div>
<?php }?>